<%= error_messages_for 'department' %>

<% html_title "#{l(:label_department)} ##{@department.id}: #{@department.name}" %>

<div class="contextual">
  <%= link_to l(:button_edit), edit_department_path(@department), :class => 'icon icon-edit' if User.current.allowed_people_to?(:edit_departments) %>
  <%= link_to l(:button_delete), department_path(@department), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' if User.current.allowed_people_to?(:delete_departments) %>
</div>

<h2><%= l(:label_department) %> #<%= @department.id %></h2>

<div class="department issue details">


  <%= avatar(@department.head, :size => "50") %>

<div class="subject">
<h3><%= @department.name %></h3>
</div>
        <p class="author">
          <%= l(:label_department_head) %>
          <%= link_to_user @department.head %>
        </p>

  <% if @department.background? || @department.attachments.any? -%>

  <% if @department.background? %>
    <p><strong><%=l(:label_people_background)%></strong></p>
    <div class="wiki">
    <%= textilizable @department, :background, :attachments => @department.attachments %>
    </div>
  <% end %>
  <%= link_to_attachments @department, :thumbnails => true %>
  <% end -%>
</div>

<% content_for :sidebar do %>
  <div id="department_people">
    <h3><%= l(:label_people) %></h3>
    <%= render :partial => 'people/person_data', :collection => @department.people.active %>
  </div>

<% end %>

<% content_for :header_tags do %>
  <%= javascript_include_tag :people, :plugin => 'redmine_people'  %>
  <%= stylesheet_link_tag :people, :plugin => 'redmine_people' %>
<% end %>